<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>演示Axios发送异步请求给服务器，服务器响应请求给客户端</title>
    <meta content="" charset="UTF-8">
    <script language="JavaScript" src="script/vue.js"></script>
    <script language="JavaScript" src="script/axios.min.js"></script>
    <script type="" language="JavaScript">
        window.onload = function () {
            var vue = new Vue({
                        // # 表示id
                        // . 表示class
                        "el": "#div0",
                        "data": {
                            uname: "jack",
                            pwd: "ok"
                        },
                        methods: {
                            axios03: function () {
                                axios({
                                    "method": "post",
                                    "url": "axios03.do",
                                    "data": {
                                        "uname": vue.uname,
                                        "pwd": vue.pwd
                                    }
                                }).then(function (response) {
                                    var data = response.data;
                                    console.log(data);
                                    vue.uname = data.uname;
                                    vue.pwd = data.pwd;

                                    var str = "";
                                    JSON.stringify(str);
                                    JSON.parse(str);

                                }).catch(function (error) {
                                    console.log(error);
                                });
                            }
                        }
                    }
                )
            ;
        }
    </script>
</head>
<body>
<div id="div0">
    账号:<input type="text" v-model="uname"></input>
    密码:<input type="text" v-model="pwd"></input>
    <input type="button" @click="axios03" value="提交"></input>
</div>
</body>
</html>